<?php foreach ($datas as $datas):?>
           <tr>   
                  <td style="display: none;"><?php echo $datas['id'] ?></td>
                  <td><?php echo $datas['name'] ?></td>
                  <td><input type="text" name="rate" class="rate" value="<?php echo $datas['rate1'] ?>"> </td>
                  <td><input type="text" name="rate1" class="rate" value="<?php echo $datas['rate2'] ?>"> </td>
                  <td><?php echo $datas['rate_time'] ?>  </td>
                  <td><input type="button" disabled="disabled" value="保存" class="btn"></td>
           </tr>
<?php endforeach;?>
<tr>
      <td colspan="5" style="display: none;"><div class="mypage"><?php echo $pager_links;?></div> </td>
</tr>
<script type="text/javascript">
$(function() {
	$('.rate').blur(function(){
		  var reg = new RegExp("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");
		  var r =reg.test($(this).val());       
        if(!r){ 
        	var dialog = art.dialog({title: '警告',icon:'question',lock: true});
      		dialog.content('<p>输入的汇率格式错误，必须是非负数<p>'); 
		   var tds=$(this).parent().siblings();
		  var btn=tds.eq(4).find('input');
		  btn.attr('class','btn  btn-save').attr('disabled',true).val('保存');
        }
		
	});
});


</script>
